/**
 * @description 获取多个节点的布局信息
 * @param {string} selector 选择器
 * @param {object} instance 实例
 * @returns {Promise} Promise.then(data)
 */
export default function getRects(selector, instance) {
	if (!selector) return Promise.reject("请传入选择器");
	if (!instance) return Promise.reject("请传入实例");
	return new Promise((resolve, reject) => {
		const query = uni.createSelectorQuery().in(instance);
		query
			.selectAll(selector)
			.boundingClientRect((data) => {
				resolve(data);
			})
			.exec();
	});
}
